<template>
	<view v-for="(item,index) in commentList" :key="index" class="flex-s-s" style="padding-bottom: 50rpx;">
		<view>
			<van-image width="100rpx" height="100rpx" round :src="item.user.avatar_text" />
		</view>
		<view class="p-l-12">
			<view class="t-14 color4 p-b-8">
				<text>{{item.user.username}}</text>
				<text class="p-l-6">{{item.updatetime_text}}</text>
			</view>
			<view class="p-b-12 t-14">
				{{item.remake}}
			</view>
			<view>
				<van-icon color="#3c91ff" name="location" />
				<text c class="t-14">{{item.shcoolName}}</text>
			</view>
		</view>
	</view>
	<view class="send-comment">
		<van-field :value="comment" center clearable placeholder="请输入评论内容" :border="false" use-button-slot
			@change="inputComment">
			<van-button slot="button" color="#3c91ff" round size="small" type="primary" @click="sendComment">
				发送
			</van-button>
		</van-field>
	</view>
</template>

<script>
	export default {
		name: "ppl-commentList",
		props: {
			commentList: Array
		},
		data() {
			return {
				comment: '',
				schoolName: ''
			};
		},
		methods: {
			inputComment({
				detail
			}) {
				this.comment = detail;
			},
			//发送评论
			async sendComment() {
				await this.$emit('sendComment', this.comment);
				this.comment = '';
			}
		}
	}
</script>

<style scoped>
	.send-comment {
		width: 100%;
		height: 100px;
		position: fixed;
		bottom: 0;
		left: 0;
		background-color: #fff;
	}
</style>